From 59e8c71786fd1c154904b3fefa7d26d88f4d92d2 Mon Sep 17 00:00:00 2001 From: Marcus Otterström Date: Fri, 8 Jul 2022 22:08:32 +0200 Subject: Format astro files in examples (#3862) --- .../src/pages/posts/[...page].astro | 33 ++++++++++++++-------- 1 file changed, 22 insertions(+), 11 deletions(-) (limited to 'examples/blog-multiple-authors/src/pages/posts/[...page].astro') diff --git a/examples/blog-multiple-authors/src/pages/posts/[...page].astro b/examples/blog-multiple-authors/src/pages/posts/[...page].astro index f770aadb2..8a6c9a730 100644 --- a/examples/blog-multiple-authors/src/pages/posts/[...page].astro +++ b/examples/blog-multiple-authors/src/pages/posts/[...page].astro @@ -1,13 +1,15 @@ --- -import MainHead from '../../components/MainHead.astro'; -import Nav from '../../components/Nav.astro'; -import PostPreview from '../../components/PostPreview.astro'; -import Pagination from '../../components/Pagination.astro'; -import authorData from '../../data/authors.json'; +import MainHead from "../../components/MainHead.astro"; +import Nav from "../../components/Nav.astro"; +import PostPreview from "../../components/PostPreview.astro"; +import Pagination from "../../components/Pagination.astro"; +import authorData from "../../data/authors.json"; export async function getStaticPaths({ paginate, rss }) { - const allPosts = await Astro.glob('../post/*.md'); - const sortedPosts = allPosts.sort((a, b) => new Date(b.frontmatter.date).valueOf() - new Date(a.frontmatter.date).valueOf()); + const allPosts = await Astro.glob("../post/*.md"); + const sortedPosts = allPosts.sort( + (a, b) => new Date(b.frontmatter.date).valueOf() - new Date(a.frontmatter.date).valueOf() + ); // Generate an RSS feed from this collection of posts. // NOTE: This is disabled by default, since it requires `site` to be set in your "astro.config.mjs" file. @@ -28,8 +30,8 @@ export async function getStaticPaths({ paginate, rss }) { } // page -const title = 'Don’s Blog'; -const description = 'An example blog on Astro'; +const title = "Don’s Blog"; +const description = "An example blog on Astro"; const { canonicalURL } = Astro; const { page } = Astro.props; --- @@ -37,7 +39,14 @@ const { page } = Astro.props; {title} - +